import {ADD_PERSON} from "../constant";
//初始化人的列表
const initState = [{id: '001', name: 'tom', age: 18}];
export default function personReducer(perState = initState, action) {
    const {type, data} = action
    switch (type) {
        // 添加一个人
        case ADD_PERSON:
            return [data, ...perState]
        default:
            return perState;
    }
}